package com.atguigu.gulimall.common.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author: xuesm
 * @date: 2024/12/9 21:44
 */
@Documented
@Constraint(validatedBy = {ListValueConstraintValidator.class})		// 参考其它注解这需要指定一个validatedBy
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)	// 运行时机
public @interface ListValue {

    String message() default "{javax.validation.constraints.ListValue.message}";	// 这个是校验未通过提示，可以在ValidationMessages.properties中配置
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
    int[] vals() default  {};
}
